<template>
  <div>
     <!-- 账户变更 -->
    <div>
      <el-form :inline="true" :model="form" class="demo-form-inline">
        <!-- {{dateTimer}} -->
        {{time}}
        <el-date-picker
          v-model="time"
          value-format="timestamp"
          type="datetimerange"
          :picker-options="pickerOptions"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          align="right"
        ></el-date-picker>
        <el-form-item>
          <el-select
            v-model="form.applyType"
            placeholder="请选择类型"
            style="margin-left:10px"
            clearable
          >
            <el-option label="充值" value="充值"></el-option>
            <el-option label="提现" value="提现"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select v-model="form.status" placeholder="请选择状态" clearable>
            <el-option label="通过" value="通过"></el-option>
            <el-option label="不通过" value="不通过"></el-option>
            <el-option label="未审核" value="未审核"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="toSearch">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
import {pageQueryCustomerAccount} from '@/api/account'
export default {
  data() {
    return {
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            }
          }
        ]
      },
      params:{
          page:1,
          pageSize:10
      },
      time: [],
      form: {}
    };
  },
  
  created(){
      this.queryData()
  },
  methods:{
      toSearch(){
          this.queryData()
      },
       async queryData(){
      let temp={
          ...this.params,
          ...this.form
      }
      if(this.time){
          temp.beginTime=this.time[0];
          temp.endTime=this.time[1];
      }
      let res=await pageQueryCustomerAccount(temp)
      console.log(res)
  }
  }
 
};
</script> 

<style lang="scss">
</style>